<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ng-checked，全选，取消</title>
    <script src="../angular.js"></script>
</head>
<body>
    <!--ng-checked 默认不选中， true选中， false不选中-->
    <!--ng-bind 以表达式的形式表达值-->
    <div ng-app="gg" ng-controller="ctrl">
        <!--选择：<input type="checkbox" ng-checked="true" />-->
        <table border="1" width="500">
            <tr>
                <th>
                    <input type="checkbox" ng-model="all">
                    <span ng-bind="all ? '取消': '全选'"></span>
                </th>
                <th>name</th>
                <th>age</th>
            </tr>
            <tr ng-repeat="(k,v) in user">
                <td><input type="checkbox" ng-checked="all" ></td>
                <td>{{v.name}}</td>
                <td>{{v.age}}</td>
            </tr>
        </table>
    </div>
    
<script>
    var mod = angular.module('gg', []);
    mod.controller('ctrl', ['$scope', function ($scope) {
        $scope.user = [
            {name:'gg', age: 22},
            {name:'qc', age: 18}
        ];
    }])
</script>
</body>
</html>